<?php
    @header("Content-Type:text/html;charset=utf-8");

    @include_once("conn.php");   // 引入conn.php (链接mysql)
    @include_once("common.php");

    if(!(isset($_POST["user"])&&isset($_POST["orderList"]))){
        paramsErr();
    }

    $user = $_POST["user"];
    $orderList = $_POST["orderList"];
    $orderId = $_POST["orderId"];
    // 提交订单需要用户 选择的商品 
    $sql = "insert into `orderlist` (user,orderList,orderId) values ('$user','$orderList','$orderId')";
    $result = mysqli_query($conn,$sql);
    $obj = array();
    if($result){
            $obj["status"] =true;
            $obj["msg"] = "新增成功";
    }else{
        $obj["status"] = false;
        $obj["msg"] = "sql语句有误";
        $obj["sql"] = $sql;
    }
   
    echo json_encode($obj);
?>